package com.example.cursor.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.cursor.entity.Student;
import com.example.cursor.mapper.StudentMapper;
import com.example.cursor.service.StudentService;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements StudentService {
    
    @Override
    public boolean save(Student student) {
        student.setCreatedTime(LocalDateTime.now());
        student.setUpdatedTime(LocalDateTime.now());
        return super.save(student);
    }

    @Override
    public boolean updateById(Student student) {
        student.setUpdatedTime(LocalDateTime.now());
        return super.updateById(student);
    }
} 